package sisvoto.Utiles;


import java.io.IOException;
import java.io.PrintStream;

public class Respaldo
{

    public Respaldo()
    {
    }

    public static void export(String path1, String user, String pass, String bd)
    {
        String path = path1;
        String file = (new StringBuilder("mysqldump  -u ")).append(user).append(" -p").append(pass).append(" ").append(bd).append(" > ").append(path).toString();
        String dumpCommand = (new StringBuilder("cmd /c ")).append(file).toString();
        System.out.println(dumpCommand);
        Runtime rt = Runtime.getRuntime();
        Process proc;
        try
        {
            proc = rt.exec(dumpCommand);
            //proc.destroy();

        }
        catch(IOException e)
        {
            e.printStackTrace();
        }

    }
   
    //public static void main(String[]args){
    //    Respaldo.export("C:/sisvoto.sql", "root", "root", "sisvoto");
    //}
}